Quick Guide For SQL by Mehta Heer & Verma Prince

Quick Guide For SQL by Mehta Heer & Verma Prince

Author:Mehta, Heer & Verma, Prince
Language: eng
Format: epub
Publisher: Edignite NGO
Published: 2022-01-02T00:00:00+00:00


and

ALTER TABLE table_name

ADD CONSTRAINT constraint_name

FOREIGN KEY(column_name) REFERENCES tablename(column_name);

To set the Foriegn Key in orders table, we would need to execute the following command: -

ALTER TABLE orders ADD CONSTRAINT cost_to_orders FOREIGN KEY(cost_id) REFERENCES costumers(cost_id);

Upon describing the table, it will give the following output.

Here, we now have MUL in the key column corresponding to cost_id.

Joins in SQL

Sometimes we need to represent the data of two inter-related tables at once. This can be done by Joins.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.